//
//  HTGroupTableViewCell.m
//  HeartTravel
//
//  Created by lanou on 15/10/24.
//  Copyright © 2015年 tantan. All rights reserved.
//

#import "HTGroupTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation HTGroupTableViewCell
- (void)setConfigureModel:(HTGroupModel *)configureModel
{
    _configureModel = configureModel;
    [_posterImageView sd_setImageWithURL:[NSURL URLWithString:configureModel.img_url]];
    _titleLabel.text = configureModel.title;
    _authorLabel.text = configureModel.user_data.user_name;
    _ilView.lookLabel.text = configureModel.view_cnt;
    _ilView.likeLabel.text = configureModel.favorite_cnt;
    _ilView.commentLabel.text = configureModel.comment_cnt;
//    if ([configureModel.premium isEqualToString:@"1"]) {
//        _toTopLabel.backgroundColor = [UIColor colorWithRed:1.000 green:0.539 blue:0.376 alpha:1.000];
//        _toTopLabel.text = @"置顶";
//        _toTopLabel.textColor = [UIColor whiteColor];
//    }
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        CGFloat height = 500*SCREEN_WIDTH / 750;
        _posterImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 5, SCREEN_WIDTH, height)];
        
        _toTopLabel = [[UILabel alloc]initWithFrame:CGRectMake(25, 5, 20, 15)];
        _toTopLabel.font = [UIFont systemFontOfSize:10];
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(25, 130, SCREEN_WIDTH - 50, 80)];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.font = [UIFont systemFontOfSize:20];
        _titleLabel.numberOfLines = 0;
        
        _authorLabel = [[UILabel alloc]initWithFrame:CGRectMake(25, 220, 100, 20)];
        _authorLabel.font = [UIFont systemFontOfSize:13];
        _authorLabel.textColor = [UIColor whiteColor];
        
        _ilView = [[ILView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 180, 220, 180, 20)];
        
        _posterImageView.backgroundColor = [UIColor colorWithRed:0.447 green:1.000 blue:0.963 alpha:1.000];
        _titleLabel.text = @"丰富的范德萨发生的范德萨发的浪费地方看电视";
        _authorLabel.text = @"范德萨范德";
        
        [self.contentView addSubview:_posterImageView];
        [self.contentView addSubview:_toTopLabel];
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_authorLabel];
        [self.contentView addSubview:_ilView];
        
    }
    return self;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
